package com.polukeuro.app.utils;

import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.RequestCallback;
import com.google.gwt.http.client.RequestException;

public class RequestHelper {
	
	
	public static void doPost(String url, String postData,
			RequestCallback requestCallback) {
		RequestBuilder builder = new RequestBuilder(RequestBuilder.POST, url);
		builder.setHeader("Content-Type", "application/json");
		builder.setHeader("Accept","application/json");
		try {
			Request response = builder.sendRequest(postData, requestCallback);
		} catch (RequestException e) {
			
		}
	}

	public static void doGet(String url, RequestCallback requestCallback) {
		RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, url);
		builder.setHeader("Content-Type", "application/json");
		builder.setHeader("Accept","application/json");
		try {
			Request response = builder.sendRequest("", requestCallback);
		} catch (RequestException e) {
		}
	}



}
